package com.jxs.android.weiget;

import android.content.Context;
import android.util.AttributeSet;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.jxs.android.ges.R;

public class Bu_A_Case_Item extends LinearLayout {
	private TextView index;
	private TextView cust_name;
	private TextView cust_manager_name;
	private TextView create_date;

	public Bu_A_Case_Item(Context context, AttributeSet attrs) {
		super(context, attrs);
		init(context);
	}

	public Bu_A_Case_Item(Context context) {
		this(context, null);
	}

	public void init(Context context) {
		LayoutInflater.from(context).inflate(R.layout.bu_list_item_a_case, this);
		index = ((TextView) findViewById(R.id.index));
		cust_manager_name = ((TextView) findViewById(R.id.cust_manager_name));
		cust_name = ((TextView) findViewById(R.id.cust_name));
		create_date = ((TextView) findViewById(R.id.create_date));
	}

	public void setValue(String i_index, String i_customer, String i_manager, String i_date) {
		index.setText(i_index);
		cust_manager_name.setText(i_manager);
		cust_name.setText(i_customer);
		create_date.setText(i_date);

	}

	public void setBackGroud(int bg) {

		index.setBackgroundResource(bg);
		cust_manager_name.setBackgroundResource(bg);
		cust_name.setBackgroundResource(bg);
		create_date.setBackgroundResource(bg);
	}

	public void setTextColor(int color) {
		index.setTextColor(color);
		cust_manager_name.setTextColor(color);
		cust_name.setTextColor(color);
		create_date.setTextColor(color);
	}

	public void setCustNameGravityCenter() {
		cust_name.setGravity(Gravity.CENTER);
	}

}
